<% # evizitei: this template is used for submissions AND quiz_submissions, make sure methods used are available on both models %>

<% define_content :link do %>
  <%= polymorphic_url([asset.assignment.context, asset.assignment, :submission], id: asset.user) %>
<% end %>

<% define_content :subject do %>
  <%= t :subject, "Grade Changed: %{assignment}, %{context}", :assignment => asset.assignment.title, :context => asset.assignment.context.name %>
<% end %>

<%= t :body, "The grade on your assignment, %{assignment_title} has been changed.", :assignment_title => asset.assignment.title %>

<%= t :regraded_date, "re-graded: %{date}", :date => (datetime_string(force_zone(asset.graded_at)) rescue t(:no_date_set, "No Date Set")) %>
<% if user.try(:send_scores_in_emails?, asset.assignment.context.root_account) %>
  <% if asset.excused? %>
<%= t :excused, "This assignment has been excused." %>
  <% elsif asset.score %>
<%= t :score, "score:  %{score} out of %{total}", :score => asset.score, :total => (asset.assignment.points_possible || t(:not_applicable, "N/A")) %>
  <% end %>
<% end %>

<%= t(:score_pending, "score pending review by the teacher") if asset.pending_review? %>

<%= t :link_message, "You can review the assignment here:" %>
<%= content :link %>
